-
Notifications
You must be signed in to change notification settings - Fork 15
docs: Add comprehensive guide for auto-compilation flow development and deployment strategies #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c8a89a2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected -t lint typecheck test --parallel -... |
❌ Failed | 7m 5s | View ↗ |
nx affected -t test:e2e --parallel --base=origi... |
✅ Succeeded | 6m 22s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-11-23 00:28:12 UTC
af6bcc5 to
d55cc0b
Compare
d55cc0b to
15033f7
Compare
🔍 Preview Deployment: Playground✅ Deployment successful! 🔗 Preview URL: https://pr-253--pgflow-demo.netlify.app 📝 Details:
_Last updated: _ |
15033f7 to
6c46ecb
Compare
6c46ecb to
a25e961
Compare
a25e961 to
cde9b89
Compare
cde9b89 to
56ed82d
Compare
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-253.pgflow.pages.dev 📝 Details:
_Last updated: _ |
56ed82d to
dcd753f
Compare
| const errorData = await response.json(); | ||
| throw new Error( | ||
| `Flow '${flowSlug}' not found.\n\n` + | ||
| `${errorData.message || 'Did you add it to flows.ts?'}\n\n` + | ||
| `Fix:\n` + | ||
| `1. Add your flow to supabase/functions/pgflow/flows.ts\n` + | ||
| `2. Restart edge functions: supabase functions serve` | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 404 error handling assumes all 404 responses mean the flow wasn't registered, but the ControlPlane server regex /^/flows/([a-zA-Z0-9_]+)$/ only accepts alphanumeric characters and underscores. If a user passes a slug with hyphens like my-flow, the route won't match and returns a generic 404 with "Route GET /flows/my-flow not found". This code will misleadingly tell users to add the flow to flows.ts when the real issue is invalid characters in the slug.
if (response.status === 404) {
const errorData = await response.json();
// Check if it's a route mismatch vs missing flow
if (errorData.error === 'Not Found' && errorData.message.includes('Route')) {
throw new Error(
`Invalid flow slug: '${flowSlug}'\n\n` +
`Flow slugs can only contain letters, numbers, and underscores.\n` +
`Example: my_flow (not my-flow)`
);
}
throw new Error(
`Flow '${flowSlug}' not found.\n\n` +
`${errorData.message || 'Did you add it to flows.ts?'}\n\n` +
`Fix:\n` +
`1. Add your flow to supabase/functions/pgflow/flows.ts\n` +
`2. Restart edge functions: supabase functions serve`
);
}| const errorData = await response.json(); | |
| throw new Error( | |
| `Flow '${flowSlug}' not found.\n\n` + | |
| `${errorData.message || 'Did you add it to flows.ts?'}\n\n` + | |
| `Fix:\n` + | |
| `1. Add your flow to supabase/functions/pgflow/flows.ts\n` + | |
| `2. Restart edge functions: supabase functions serve` | |
| ); | |
| } | |
| const errorData = await response.json(); | |
| // Check if it's a route mismatch vs missing flow | |
| if (errorData.error === 'Not Found' && errorData.message.includes('Route')) { | |
| throw new Error( | |
| `Invalid flow slug: '${flowSlug}'\n\n` + | |
| `Flow slugs can only contain letters, numbers, and underscores.\n` + | |
| `Example: my_flow (not my-flow)` | |
| ); | |
| } | |
| throw new Error( | |
| `Flow '${flowSlug}' not found.\n\n` + | |
| `${errorData.message || 'Did you add it to flows.ts?'}\n\n` + | |
| `Fix:\n` + | |
| `1. Add your flow to supabase/functions/pgflow/flows.ts\n` + | |
| `2. Restart edge functions: supabase functions serve` | |
| ); | |
| } |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
dcd753f to
0d80511
Compare
| find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i 's/\.js"/\.ts"/g' {} + | ||
| find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i "s/\.js'/\.ts'/g" {} + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed -i flag behaves differently on macOS vs Linux. On macOS, it requires a backup extension argument (e.g., sed -i ''), while on Linux it doesn't. This will cause the script to fail for developers on macOS.
# Fix for cross-platform compatibility:
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak 's/\.js"/\.ts"/g' {} + && find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -delete
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak "s/\.js'/\.ts'/g" {} + && find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -delete| find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i 's/\.js"/\.ts"/g' {} + | |
| find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i "s/\.js'/\.ts'/g" {} + | |
| find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak 's/\.js"/\.ts"/g' {} + && find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -delete | |
| find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak "s/\.js'/\.ts'/g" {} + && find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -delete | |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
57c098c to
a947cb7
Compare
…nd deployment strategies
a947cb7 to
c8a89a2
Compare

No description provided.